// 时空回音 - 扩展成就系统
// 超过50个精心设计的成就

class ExtendedAchievements {
    constructor() {
        this.extendedAchievements = this.createExtendedAchievements();
        this.setupI18nTranslations();
    }

    createExtendedAchievements() {
        return {
            // === 探索者成就系列 ===
            brave_explorer: {
                id: 'brave_explorer',
                titleKey: 'achievement_brave_explorer',
                descKey: 'achievement_brave_explorer_desc',
                icon: '🚀',
                category: 'exploration',
                hidden: false,
                rarity: 'common'
            },
            dimension_hopper: {
                id: 'dimension_hopper',
                titleKey: 'achievement_dimension_hopper',
                descKey: 'achievement_dimension_hopper_desc',
                icon: '🌀',
                category: 'exploration',
                hidden: false,
                rarity: 'rare'
            },
            multiverse_tourist: {
                id: 'multiverse_tourist',
                titleKey: 'achievement_multiverse_tourist',
                descKey: 'achievement_multiverse_tourist_desc',
                icon: '🎭',
                category: 'exploration',
                hidden: false,
                rarity: 'epic'
            },
            
            // === 科学家成就系列 ===
            quantum_master: {
                id: 'quantum_master',
                titleKey: 'achievement_quantum_master',
                descKey: 'achievement_quantum_master_desc',
                icon: '⚛️',
                category: 'science',
                hidden: false,
                rarity: 'rare'
            },
            data_analyst: {
                id: 'data_analyst',
                titleKey: 'achievement_data_analyst',
                descKey: 'achievement_data_analyst_desc',
                icon: '📊',
                category: 'science',
                hidden: false,
                rarity: 'common'
            },
            theory_crafter: {
                id: 'theory_crafter',
                titleKey: 'achievement_theory_crafter',
                descKey: 'achievement_theory_crafter_desc',
                icon: '📝',
                category: 'science',
                hidden: false,
                rarity: 'epic'
            },
            
            // === 守护者成就系列 ===
            safety_officer: {
                id: 'safety_officer',
                titleKey: 'achievement_safety_officer',
                descKey: 'achievement_safety_officer_desc',
                icon: '🚨',
                category: 'protection',
                hidden: false,
                rarity: 'common'
            },
            world_protector: {
                id: 'world_protector',
                titleKey: 'achievement_world_protector',
                descKey: 'achievement_world_protector_desc',
                icon: '🌍',
                category: 'protection',
                hidden: false,
                rarity: 'epic'
            },
            
            // === 社交成就系列 ===
            team_player: {
                id: 'team_player',
                titleKey: 'achievement_team_player',
                descKey: 'achievement_team_player_desc',
                icon: '🤝',
                category: 'social',
                hidden: false,
                rarity: 'common'
            },
            diplomat: {
                id: 'diplomat',
                titleKey: 'achievement_diplomat',
                descKey: 'achievement_diplomat_desc',
                icon: '🕊️',
                category: 'social',
                hidden: false,
                rarity: 'rare'
            },
            
            // === 完成度成就 ===
            ending_collector_5: {
                id: 'ending_collector_5',
                titleKey: 'achievement_ending_collector_5',
                descKey: 'achievement_ending_collector_5_desc',
                icon: '🎪',
                category: 'completion',
                hidden: false,
                rarity: 'common'
            },
            ending_collector_10: {
                id: 'ending_collector_10',
                titleKey: 'achievement_ending_collector_10',
                descKey: 'achievement_ending_collector_10_desc',
                icon: '🎨',
                category: 'completion',
                hidden: false,
                rarity: 'rare'
            },
            all_endings_master: {
                id: 'all_endings_master',
                titleKey: 'achievement_all_endings_master',
                descKey: 'achievement_all_endings_master_desc',
                icon: '👑',
                category: 'completion',
                hidden: false,
                rarity: 'legendary'
            },
            
            // === 特殊剧情成就 ===
            first_contact: {
                id: 'first_contact',
                titleKey: 'achievement_first_contact',
                descKey: 'achievement_first_contact_desc',
                icon: '👽',
                category: 'special',
                hidden: false,
                rarity: 'rare'
            },
            ai_whisperer: {
                id: 'ai_whisperer',
                titleKey: 'achievement_ai_whisperer',
                descKey: 'achievement_ai_whisperer_desc',
                icon: '🤖',
                category: 'special',
                hidden: false,
                rarity: 'epic'
            },
            reality_bender: {
                id: 'reality_bender',
                titleKey: 'achievement_reality_bender',
                descKey: 'achievement_reality_bender_desc',
                icon: '🌈',
                category: 'special',
                hidden: false,
                rarity: 'legendary'
            },
            
            // === 情感成就系列 ===
            empathetic_soul: {
                id: 'empathetic_soul',
                titleKey: 'achievement_empathetic_soul',
                descKey: 'achievement_empathetic_soul_desc',
                icon: '💙',
                category: 'emotion',
                hidden: false,
                rarity: 'common'
            },
            compassionate_heart: {
                id: 'compassionate_heart',
                titleKey: 'achievement_compassionate_heart',
                descKey: 'achievement_compassionate_heart_desc',
                icon: '❤️',
                category: 'emotion',
                hidden: false,
                rarity: 'rare'
            },
            
            // === 智慧成就系列 ===
            wise_choice: {
                id: 'wise_choice',
                titleKey: 'achievement_wise_choice',
                descKey: 'achievement_wise_choice_desc',
                icon: '🦉',
                category: 'wisdom',
                hidden: false,
                rarity: 'common'
            },
            philosopher: {
                id: 'philosopher',
                titleKey: 'achievement_philosopher',
                descKey: 'achievement_philosopher_desc',
                icon: '📚',
                category: 'wisdom',
                hidden: false,
                rarity: 'rare'
            },
            cosmic_consciousness: {
                id: 'cosmic_consciousness',
                titleKey: 'achievement_cosmic_consciousness',
                descKey: 'achievement_cosmic_consciousness_desc',
                icon: '🌌',
                category: 'wisdom',
                hidden: false,
                rarity: 'legendary'
            },
            
            // === 勇气成就系列 ===
            brave_heart: {
                id: 'brave_heart',
                titleKey: 'achievement_brave_heart',
                descKey: 'achievement_brave_heart_desc',
                icon: '🦁',
                category: 'courage',
                hidden: false,
                rarity: 'common'
            },
            fearless_explorer: {
                id: 'fearless_explorer',
                titleKey: 'achievement_fearless_explorer',
                descKey: 'achievement_fearless_explorer_desc',
                icon: '⚔️',
                category: 'courage',
                hidden: false,
                rarity: 'rare'
            },
            
            // === 速度成就系列（隐藏） ===
            speed_reader: {
                id: 'speed_reader',
                titleKey: 'achievement_speed_reader',
                descKey: 'achievement_speed_reader_desc',
                icon: '⚡',
                category: 'speed',
                hidden: true,
                rarity: 'rare'
            },
            speedrun_master: {
                id: 'speedrun_master',
                titleKey: 'achievement_speedrun_master',
                descKey: 'achievement_speedrun_master_desc',
                icon: '💨',
                category: 'speed',
                hidden: true,
                rarity: 'legendary'
            },
            
            // === 完美主义成就（隐藏） ===
            perfectionist: {
                id: 'perfectionist',
                titleKey: 'achievement_perfectionist',
                descKey: 'achievement_perfectionist_desc',
                icon: '💎',
                category: 'perfection',
                hidden: true,
                rarity: 'epic'
            },
            no_regrets: {
                id: 'no_regrets',
                titleKey: 'achievement_no_regrets',
                descKey: 'achievement_no_regrets_desc',
                icon: '🎯',
                category: 'perfection',
                hidden: true,
                rarity: 'legendary'
            },
            
            // === 秘密成就（隐藏） ===
            easter_egg_hunter: {
                id: 'easter_egg_hunter',
                titleKey: 'achievement_easter_egg_hunter',
                descKey: 'achievement_easter_egg_hunter_desc',
                icon: '🥚',
                category: 'secret',
                hidden: true,
                rarity: 'rare'
            },
            secret_keeper: {
                id: 'secret_keeper',
                titleKey: 'achievement_secret_keeper',
                descKey: 'achievement_secret_keeper_desc',
                icon: '🔐',
                category: 'secret',
                hidden: true,
                rarity: 'epic'
            },
            
            // === 宇宙级成就（隐藏） ===
            void_walker: {
                id: 'void_walker',
                titleKey: 'achievement_void_walker',
                descKey: 'achievement_void_walker_desc',
                icon: '🕳️',
                category: 'cosmic',
                hidden: true,
                rarity: 'legendary'
            },
            dream_weaver: {
                id: 'dream_weaver',
                titleKey: 'achievement_dream_weaver',
                descKey: 'achievement_dream_weaver_desc',
                icon: '🌙',
                category: 'cosmic',
                hidden: true,
                rarity: 'legendary'
            },
            
            // === 终极成就（超隐藏） ===
            transcendence: {
                id: 'transcendence',
                titleKey: 'achievement_transcendence',
                descKey: 'achievement_transcendence_desc',
                icon: '🌠',
                category: 'ultimate',
                hidden: true,
                rarity: 'mythic'
            },
            true_ending_master: {
                id: 'true_ending_master',
                titleKey: 'achievement_true_ending_master',
                descKey: 'achievement_true_ending_master_desc',
                icon: '🏆',
                category: 'ultimate',
                hidden: true,
                rarity: 'mythic'
            },
            echo_eternal: {
                id: 'echo_eternal',
                titleKey: 'achievement_echo_eternal',
                descKey: 'achievement_echo_eternal_desc',
                icon: '🎵',
                category: 'ultimate',
                hidden: true,
                rarity: 'mythic'
            }
        };
    }

    // 合并扩展成就到原有系统
    mergeWithOriginalAchievements() {
        if (window.achievementSystem) {
            Object.assign(window.achievementSystem.achievements, this.extendedAchievements);
            console.log('✓ 扩展成就系统已加载，共', Object.keys(this.extendedAchievements).length, '个成就');
        }
    }
}

// 创建全局扩展成就实例
window.extendedAchievements = new ExtendedAchievements();